<%@ page import="aca.Turma" %>



<div class="fieldcontain ${hasErrors(bean: turmaInstance, field: 'nome', 'error')} required">
	<label for="nome">
		<g:message code="turma.nome.label" default="Nome" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="nome" required="" value="${turmaInstance?.nome}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: turmaInstance, field: 'professor', 'error')} required">
	<label for="professor">
		<g:message code="turma.professor.label" default="Professor" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="professor" name="professor.id" from="${aca.Professor.list()}" optionKey="id" required="" value="${turmaInstance?.professor?.id}" class="many-to-one"/>
</div>

<div class="fieldcontain ${hasErrors(bean: turmaInstance, field: 'disciplina', 'error')} required">
	<label for="disciplina">
		<g:message code="turma.disciplina.label" default="Disciplina" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="disciplina" required="" value="${turmaInstance?.disciplina}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: turmaInstance, field: 'periodo', 'error')} required">
	<label for="periodo">
		<g:message code="turma.periodo.label" default="Periodo" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="periodo" required="" value="${turmaInstance?.periodo}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: turmaInstance, field: 'alunos', 'error')} ">
	<label for="alunos">
		<g:message code="turma.alunos.label" default="Monitores" />
		
	</label>
	<g:select name="alunos" from="${aca.Aluno.list()}" multiple="multiple" optionKey="id" size="5" value="${turmaInstance?.alunos*.id}" class="many-to-many"/>
</div>

<div class="fieldcontain ${hasErrors(bean: turmaInstance, field: 'atividades', 'error')} ">
	<label for="atividades">
		<g:message code="turma.atividades.label" default="Atividades" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${turmaInstance?.atividades?}" var="a">
    <li><g:link controller="atividade" action="show" id="${a.id}">${a?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="atividade" action="create" params="['turma.id': turmaInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'atividade.label', default: 'Atividade')])}</g:link>
</li>
</ul>

</div>

